import axios from 'axios'
import to from './abc'
// 引入axios模块,封装基地址
const axios2 = axios.create({
  baseURL: 'http://toutiao-app.itheima.net'
})
// 函数形参是对象的解构赋值

export default ({
  url, method = 'GET', params = {}, data = {}, header = {}
}) => to(axios2({
  url: url,
  method: method,
  params: params,
  data: data,
  header: header
}))
